<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class NewFlowOrder extends Model
{
    const RISK_STATUS_SUCCESS = 1; //风控成功
    const RISK_STATUS_REFUSE = 2;  //风控拒绝

    const MONEY_STATUS_SUCCESS = 1;  //资方成功
    const MONEY_STATUS_FAILURE = 2;  //资方失败
    const DOWN_MONEY_STATUS_SUCCESS = 1;  //放款成功
    const DOWN_MONEY_STATUS_FAILURE = 2;  //放款失败

    //
    protected $fillable = [
        'loan_requests_id','user_id','name','num','phone','source','product_name','user_apply_limit',
        'user_apply_time','risk_apply_time','risk_result_time','risk_result_limit',
                           'risk_status','loan_request_apply_time','loan_request_result_time',
        'loan_request_status','loan_request_limit','loan_commit_time',
        'loan_status','loan_time','loan_limit','capital_name','message'];


//    public function getUserApplyLimitAttribute() {
//        return $this->attributes['user_apply_limit'] / 100;
//    }
//
//    public function setUserApplyLimitAttribute($value) {
//        $this->attributes['user_apply_limit'] = $value * 100;
//    }
//
    public function getRiskResultLimitAttribute() {
        return $this->attributes['risk_result_limit'] / 100;
    }

    public function setRiskResultLimitAttribute($value) {
        $this->attributes['risk_result_limit'] = $value * 100;
    }

    public function getLoanRequestLimitAttribute() {
        return $this->attributes['loan_request_limit'] / 100;
    }

    public function setLoanRequestLimitAttribute($value) {
        $this->attributes['loan_request_limit'] = $value * 100;
    }
//
//    public function getLoanLimitAttribute() {
//        return $this->attributes['loan_limit'] / 100;
//    }
//
//    public function setLoanLimitAttribute($value) {
//        $this->attributes['loan_limit'] = $value * 100;
//    }





}
